package com.grace.service.impl;

import com.github.pagehelper.PageHelper;
import com.grace.entity.Orders;
import com.grace.mapper.OrdersMapper;
import com.grace.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrdersServiceImpl implements OrdersService {

    @Autowired
    private OrdersMapper ordersMapper;

/*    @Override
    public List<Orders> findAll() {
        return ordersMapper.findAll();
    }*/

    @Override
    public List<Orders> findAll(int pageNum, int pageSize) {
        //参数pageNum是页码值 参数pageSize表示每页显示条数
        PageHelper.startPage(pageNum, pageSize);
        return ordersMapper.findAll();
    }

    @Override
    public Orders findById(String ordersId) {
        return ordersMapper.findById(ordersId);
    }


}
